//
//  ShotTableViewCell.m
//  HuiPinzhijia
//
//  Created by MS on 16/8/31.
//  Copyright © 2016年 LLMPro. All rights reserved.
//

#import "ShotTableViewCell.h"

@implementation ShotTableViewCell
{
    int _price;
}

- (void)updateMyCellWithModel:(NSString *)model
{
    _num = 1;
    _priceL.text = @"600";
    _price = [_priceL.text intValue];
}
//商品数量增加按钮
- (IBAction)upBtn:(id)sender
{
    
    _num++;
    _numberL.text = [NSString stringWithFormat:@"%d",_num];
    
    
    _priceL.text = [NSString stringWithFormat:@"%d",_num*_price];
    
}
//商品数量减少按钮
- (IBAction)dwonBtn:(id)sender
{
    if (_num <= 1)
    {
        _num = 1;
    }
    else
    {
        _num--;
        _numberL.text = [NSString stringWithFormat:@"%d",_num];
    }

    _priceL.text = [NSString stringWithFormat:@"%d",_num*_price];
    
}
//删除商品按钮
- (IBAction)deleteBtn:(id)sender
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(deleteTheShop)])
    {
        [self.delegate deleteTheShop];
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
